import { homeListApi,homeContentApi, } from "@/api/home";
import { detailApi } from '@/api/detail'
import { swipeApi,communityApi,newslistApi } from '@/api/homepage'
import { activeListApi } from '@/api/activelist'
let actions = {
    async homeListData(context,data){
        let result = await homeListApi(data);
        console.log('列表拖拉条数据',result);
        context.commit('homeListDatas',result.data.data)
    },
    // async homeContentData(context,data){
    //     let result = await homeContentApi(data);
    //     console.log('列表下内容数据',result);
    //     context.commit('homeContentDatas',result.data.data)
    // },detailApi
    async detailData(context,data){
        let result = await detailApi(data);
        // console.log('详情页数据',result);
        context.commit('detailDatas',result.data)
    },
    async swipeData(context,data){
        let result = await swipeApi(data);
        // console.log('轮播图的数据',result.data.data);
        context.commit('swipeDatas',result.data.data)
    },
    async communityData(context,data){
        let result = await communityApi(data);
        // console.log('社区活动数据',result.data.data[0].data);
        context.commit('communityDatas',result.data.data[0].data)
    },
    async activeListData(context,data){
        let result = await activeListApi(data);
        // console.log('社区活动列表数据',result.data.data);
        context.commit('activeListDatas',result.data.data)
    },
    async newslistData(context,data){
        let result = await newslistApi(data);
        console.log('首页新闻列表数据',result.data.data.data);
        context.commit('newslistDatas',result.data.data.data)
    }
}
export default actions